<template>
  <div class="home-container">
    <div class="welcome-section">
      <h1>欢迎使用 Vue AI 示例项目</h1>
      <p class="description">这是一个基于Vue 3和Vite的示例项目，展示了各种前端功能和组件。</p>
    </div>
    
    <div class="features-section">
      <h2>功能列表</h2>
      <div class="feature-cards">
        <div class="feature-card" @click="navigateTo('/tav')">
          <h3>测试Axios</h3>
          <p>展示基本的Axios HTTP请求示例</p>
          <div class="card-action">查看 &rarr;</div>
        </div>
        
        <div class="feature-card" @click="navigateTo('/zxyf')">
          <h3>测试智学云帆Axios</h3>
          <p>智学云帆API集成示例</p>
          <div class="card-action">查看 &rarr;</div>
        </div>
        
        <div class="feature-card" @click="navigateTo('/stream')">
          <h3>测试流式响应</h3>
          <p>流式数据处理和展示示例</p>
          <div class="card-action">查看 &rarr;</div>
        </div>
        
        <div class="feature-card" @click="navigateTo('/chat')">
          <h3>在线聊天</h3>
          <p>基于WebSocket的实时聊天功能</p>
          <div class="card-action">查看 &rarr;</div>
        </div>
        
        <div class="feature-card" @click="navigateTo('/wish-wall')">
          <h3>高考许愿墙</h3>
          <p>为高考学子送上祝福与期望</p>
          <div class="card-action">查看 &rarr;</div>
        </div>
      </div>
      
      <h2>富文本编辑器</h2>
      <div class="feature-cards">
        <div class="feature-card" @click="navigateTo('/richtext')">
          <h3>Quill编辑器</h3>
          <p>功能强大的Quill富文本编辑器</p>
          <div class="card-action">查看 &rarr;</div>
        </div>
        
        <div class="feature-card" @click="navigateTo('/tinymce')">
          <h3>简易编辑器</h3>
          <p>简单易用的自定义富文本编辑器</p>
          <div class="card-action">查看 &rarr;</div>
        </div>
        
        <div class="feature-card" @click="navigateTo('/ckeditor')">
          <h3>CKEditor编辑器</h3>
          <p>专业的CKEditor 5富文本编辑器</p>
          <div class="card-action">查看 &rarr;</div>
        </div>
        
        <div class="feature-card" @click="navigateTo('/tiptap')">
          <h3>TipTap编辑器</h3>
          <p>基于ProseMirror的TipTap编辑器</p>
          <div class="card-action">查看 &rarr;</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

const navigateTo = (path) => {
  router.push(path)
}
</script>

<style scoped>
.home-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.welcome-section {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 20px;
  background-color: #f0f8ff;
  border-radius: 8px;
}

h1 {
  font-size: 32px;
  color: #409eff;
  margin-bottom: 16px;
}

.description {
  font-size: 18px;
  color: #606266;
  max-width: 800px;
  margin: 0 auto;
}

.features-section {
  margin-top: 40px;
}

h2 {
  font-size: 24px;
  color: #2c3e50;
  margin-bottom: 20px;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
}

.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.feature-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  padding: 20px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.feature-card h3 {
  font-size: 20px;
  color: #409eff;
  margin-bottom: 10px;
}

.feature-card p {
  color: #606266;
  margin-bottom: 20px;
}

.card-action {
  color: #409eff;
  font-weight: bold;
  text-align: right;
}

@media (max-width: 768px) {
  .feature-cards {
    grid-template-columns: 1fr;
  }
  
  .welcome-section {
    padding: 30px 15px;
  }
  
  h1 {
    font-size: 28px;
  }
}
</style> 